﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GuiNetE
{
    public partial class meny : Form
    {
        Form2 secondForm = new Form2();
        private double Tal;
        public meny()
        {
            InitializeComponent();
        }

        private void meny_Load(object sender, EventArgs e)
        {

        }

        public bool Init { get; set; }
        
        private void läsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if ( secondForm.ShowDialog() == DialogResult.OK)
            {
                Tal = secondForm.SkrivetTal;
                Init = true;
            }
            else
            {
                Init = false;
            }
            
        }

        private void avslutaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void skrivToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (Init == false)
            {
                MessageBox.Show("Inmatning skedde ej", "Inmatat");
            }

            else
            {
                MessageBox.Show("" + Tal, "Inmatat");
            }
          
        }
    }
}
